<?php

App::uses('AppModel', 'Model');

/**
 * QuestionChoice Model
 *
 */
class QuestionChoice extends AppModel {

    var $actsAs = array(
        'Image' => array(
            'fields' => array(
                'image' => array(
                    'thumbnail' => array('create' => true),
                    'resize' => array(
                        'width' => '800',
                        'height' => '800',
                    ),
                    'versions' => array(
                        array('prefix' => 'thumb',
                            'width' => '300',
                            'height' => '130',
                        )
                    )
                )
            )
        )
    );

    public function beforeSave($options = array()) {
        parent::beforeSave($options);
        if (is_array($this->data["QuestionChoice"]["image"]))
            $this->data["QuestionChoice"]["image"] = "1";
    }

}
